﻿using Microsoft.AspNetCore.Components.Rendering;

namespace Bootstrap5.Abstractions;

public abstract class BootstrapChildContentWithCascadingValueComponentBase<TValue>:BootstrapChildContentComponentBase
{
    protected bool IsFixed { get; set; }
    protected string Name { get; set; }

    protected override void BuildRenderTree(RenderTreeBuilder builder)
    {
        var tagName = GetHtmlTagName();
        builder.OpenElement(0, tagName);
        BuildCommonAttributes(builder);
        this.CreateCascadingValueComponent<TValue>(builder, ChildContent, Name, IsFixed);
        builder.CloseElement();
    }
}
